//
//  SingleSectionViewController.m
//  UKListManager
//
//  Created by ET|冰琳 on 16/11/4.
//  Copyright © 2016年 UK. All rights reserved.
//

#import "SingleSectionViewController.h"
#import <UKListManager/UKListManager.h>

@interface SingleSectionViewController ()

@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UKTableViewProxy *tableViewProxy;
@property (nonatomic, strong) UKSingleSectionListDataContainer *dataContainer;

@end

@implementation SingleSectionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView = [UITableView new];
    [self.view addSubview:self.tableView];
    
    self.dataContainer = [UKSingleSectionListDataContainer new];
    
    [self.dataContainer.listData addObject:@"单种cell单section"];
    [self.dataContainer.listData addObject:@"单种cell每section 行数为1"];
    [self.dataContainer.listData addObject:@"多种cell"];
    
    
    self.tableViewProxy = [[UKTableViewProxy alloc] initWithIdentifier:@"cell" cacheHeight:false dataSource:self.dataContainer
                                                            cellConfig:^(UITableViewCell * cell, NSString * data, NSIndexPath *indexPath) {
                                                                cell.textLabel.text = data;
                                                                
                                                            }];
    
    [self.tableViewProxy setSelectItemAction:^(id data, NSIndexPath *indexPath) {
        
    }];
    
    
    self.tableView.delegate = self.tableViewProxy;
    self.tableView.dataSource = self.tableViewProxy;
    
 
    
}

- (void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    self.tableView.frame = self.view.bounds;
}

@end
